Robotics 1.0 Lesson Plan
Lesson 9 - Open Sesame

Purpose: To learn how an IR sensor detects objects and to build a simple automatic door system using a servo motor and an IR sensor.

No. of Classes

1 class (Duration: 1 hour 30 minutes; maximum 4 students per group).

Materials Required

    Desktop or laptop computer, CPX board, USB cable

    Micro Servo 9g

    IR sensor

Prior Knowledge

Familiarity with servo motors and controlling angles (0°–180°)

Experience connecting components using jumper wires

Using a computer and Mu Editor to upload code to the CPX

Exercises

Exercise:1



Introduction to IR Sensor:


Click here to view the instructions for the connections

Click here to view the explanation and code


Exercise:2



Build a simple automatic door system using IR Sensor and CPX:


Click here to view the instruction video for building the door system

Click here to view the pseudocode for this exercise

Solution



  • Click here to see the solution video for Exercise 2

  • Click here to view the instructions and code for Exercise 2

  • Teacher's Instruction
    1. Explain the objective of the activity.
    2. Introduce the required materials (CPX board, IR sensor, servo motor, jumper wires, USB cable, and Mu Editor).
    3. Explain that an IR sensor detects objects and sends a digital signal to the CPX.
    4. Introduce the servo motor and explain how its angle (0°–180°) controls the door position.
    5. Ensure students understand the condition: LOW = object detected -> door opens; HIGH = no object -> door closes.
    6. Provide step-by-step guidance and demonstrate troubleshooting techniques.
    7. How do you think the IR sensor decides whether something is in front of it, and what factors might affect how accurately it detects objects?
    8. How does a servo motor know exactly where to stop (for example at 30°, 90°, or 180°), and what do you think the CPX is sending to help it reach that position?